package com.itlong.cloud.noncore.operate;

import com.itlong.cloud.POJO.DTO.operate.OperateAppFunctionGetPageDTO;
import com.itlong.cloud.POJO.PO.MiniProgramFunctionInfoPO;
import com.itlong.cloud.POJO.VO.app.AppFunctionInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      运营-套餐管理-小程序功能管理业务管理暴露接口
 * </desc>
 *
 * @createDate2020/3/23
 **/
@FeignClient(name = "non-core-service")
public interface IOperateMiniProgramFunctionServiceClient {

    /**
     * <desc>
     *      分页获取小程序功能列表
     * </desc>
     *
     * @param operateAppFunctionGetPageDTO 查询参数DTO
     * @return 小程序分页列表
     * @Author Zhu.yj
     * @createDate  2020/3/23
     */
    @PostMapping("/operate/packageManage/miniProgram/getFunctionPage")
    Page<MiniProgramFunctionInfoPO> getFunctionPage(@RequestBody OperateAppFunctionGetPageDTO operateAppFunctionGetPageDTO) throws Exception;

    /**
     * <desc>
     *      更改小程序功能菜单信息
     * </desc>
     *
     * @param miniProgramFunctionInfoPO 功能实体
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/3/23
     */
    @PostMapping("/operate/packageManage/miniProgram/updateFunction")
    Integer updateFunction(@RequestBody MiniProgramFunctionInfoPO miniProgramFunctionInfoPO) throws Exception;

    /**
     * <desc>
     *      删除小程序功能id
     * </desc>
     *
     * @param miniFunctionIds 小程序功能id，多个逗号隔开
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/3/23
     */
    @PostMapping("/operate/packageManage/miniProgram/deleteFunction")
    Integer deleteFunction(@RequestParam("miniFunctionIds") String miniFunctionIds) throws Exception;

    /**
     * <desc>
     *      禁用或启用小程序功能Id
     * </desc>
     *
     * @param miniFunctionId 小程序功能id
     * @param operType 操作类型 1启用 2禁用
     * @return 受影响行数
     * @Author Zhu.yj
     * @createDate  2020/3/23
     */
    @PostMapping("/operate/packageManage/miniProgram/banOrUse")
    Integer banOrUse(@RequestParam("miniFunctionId") String miniFunctionId,@RequestParam("operType") Integer operType) throws Exception;

    /**
     * <desc>
     *      根据父功能id获取子节点列表
     * </desc>
     *
     * @param miniFunctionId 小程序功能id
     * @return 小程序功能节点列表
     * @Author Zhu.yj
     * @createDate  2020/3/23
     */
    @PostMapping("/operate/packageManage/miniProgram/getChilds")
    List<AppFunctionInfoVO> getChilds(@RequestParam("miniFunctionId") String miniFunctionId) throws Exception;

    /**
     * <desc>
     *      通过套餐id获取小城功能列表
     * </desc>
     *
     * @param appPackageId 套餐id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/3/24
     */
    @PostMapping("/operate/packageManage/miniProgram/getAllotFunction")
    List<AppFunctionInfoVO> getAllotFunction(@RequestParam("appPackageId") String appPackageId) throws Exception;

    /**
     * <desc>
     *      保存小程序功能菜单
     * </desc>
     *
     * @param miniProgramFunctionInfoPO 参数实体
     * @return
     * @Author Zhu.yj
     * @createDate  2020/3/24
     */
    @PostMapping("/operate/packageManage/miniProgram/save")
    Integer save(@RequestBody MiniProgramFunctionInfoPO miniProgramFunctionInfoPO) throws Exception;

    /**
     * <desc>
     *      获取小程序功能配置
     * </desc>
     *
     * @param projectId 项目id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/3/26
     */
    @PostMapping("/operate/packageManage/miniProgram/getMiniConfig")
    List<MiniProgramFunctionInfoPO> getMiniConfig(@RequestParam("projectId") String projectId) throws Exception;

    /**
     * <desc>
     *      获取单个小程序信息
     * </desc>
     *
     * @param miniFunctionId 小程序功能id
     * @return
     * @Author Zhu.yj
     * @createDate  2020/4/1
     */
    @PostMapping("/operate/packageManage/miniProgram/getOne")
    MiniProgramFunctionInfoPO getOne(@RequestParam("miniFunctionId") String miniFunctionId) throws Exception;
}
